package oop;
/*

    * 动物类：姓名，年龄，吃饭，睡觉
    * 猫和狗
    * 动物培训接口：跳高

 */
public class Test_Interface_Animal {
    public static void main(String[] args) {

    }
}
abstract class Animal123 {
    private String name;
    private int age;

    public Animal123() {
    }

    public Animal123(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    public abstract void eat();//吃饭

    public abstract void sleep();//睡觉
}
interface Jumping {
    public void jump();
}
class Cat123456 extends Animal123 implements Jumping{
    public Cat123456() {
        super();
    }

    public Cat123456(String name, int age) {
        super(name, age);
    }

    @Override
    public void eat() {
        System.out.println("猫吃鱼!!!");
    }

    @Override
    public void sleep() {
        System.out.println("猫睡觉!!!");
    }

    @Override
    public void jump() {
        System.out.println("猫跳高！！！");
    }
}

